home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Information / CSMP Digest / volume 1 / csmp-v1-190.txt < prev    next >
Text File  |  1992-12-31  |  43KB  |  1,119 lines

  1. C.S.M.P. Digest             Tue, 20 Oct 92       Volume 1 : Issue 190
  2.  
  3. Today's Topics:
  4.  
  5.     Does THINK C have glue for FindFolder?
  6.     How do I see if modifiers are down?
  7.     Editor for mini icons?
  8.     Prolog for Mac
  9.     ATrap to Determe my Mac name?
  10.     AUX and memory
  11.     How do I sleep w/o using any CPU time
  12.     Naming my print job: how?
  13.     alias pathname
  14.  
  15.  
  16.  
  17. The Comp.Sys.Mac.Programmer Digest is moderated by Michael A. Kelly.
  18.  
  19. The digest is a collection of article threads from the internet newsgroup
  20. comp.sys.mac.programmer.  It is designed for people who read c.s.m.p. semi-
  21. regularly and want an archive of the discussions.  If you don't know what a
  22. newsgroup is, you probably don't have access to it.  Ask your systems
  23. administrator(s) for details.  (This means you can't post questions to the
  24. digest.)
  25.  
  26. Each issue of the digest contains one or more sets of articles (called
  27. threads), with each set corresponding to a 'discussion' of a particular
  28. subject.  The articles are not edited; all articles included in this digest
  29. are in their original posted form (as received by our news server at
  30. cs.uoregon.edu).  Article threads are not added to the digest until the last
  31. article added to the thread is at least one month old (this is to ensure that
  32. the thread is dead before adding it to the digest).  Article threads that
  33. consist of only one message are generally not included in the digest.
  34.  
  35. The entire digest is available for anonymous ftp from ftp.cs.uoregon.edu
  36. [128.223.8.8] in the directory /pub/mac/csmp-digest.  Be sure to read the
  37. file /pub/mac/csmp-digest/README before downloading any files.  The most
  38. recent issues are available from sumex-aim.stanford.edu [36.44.0.6] in the
  39. directory /info-mac/digest/csmp.  If you don't have ftp capability, the sumex
  40. archive has a mail server; send a message with the text '$MACarch help' (no
  41. quotes) to LISTSERV@ricevm1.rice.edu for more information.
  42.  
  43. The digest is also available via email.  Just send a note saying that you
  44. want to be on the digest mailing list to mkelly@cs.uoregon.edu, and you will
  45. automatically receive each new issue as it is created.  Sorry, back issues
  46. are not available through the mailing list.
  47.  
  48. Send administrative mail to mkelly@cs.uoregon.edu.
  49.  
  50.  
  51. -------------------------------------------------------
  52.  
  53. From: bitting-douglas@CS.YALE.EDU (Pondscum Czar)
  54. Subject: Does THINK C have glue for FindFolder?
  55. Organization: Yale CS Mail/News Gateway
  56. Date: Sun, 2 Aug 1992 19:57:27 GMT
  57.  
  58.  
  59. Hi... I am trying not to use SysEnvirons to find the system folder (as,
  60. really, SysEnvirons has been replaced w/ Sys7).  However, I need to make
  61. sure this App works under System 6 as well... Anyway, I was poking
  62. through the header files and found this in Folders.h:
  63.  
  64. - --snip here--
  65. #if SystemSevenOrLater
  66. pascal OSErr FindFolder(short vRefNum,OSType folderType,Boolean
  67. createFolder,
  68.     short *foundVRefNum,long *foundDirID)
  69.     = {0x7000,0xA823}; 
  70. #else
  71. pascal OSErr FindFolder(short vRefNum,OSType folderType,Boolean
  72. createFolder,
  73.     short *foundVRefNum,long *foundDirID);
  74. #endif
  75. - --snip here--
  76.  
  77. Does the #else clause mean that THINK C provides glue for this function
  78. like Gestalt?  In other words, can I use this under System 6 to find the
  79. Active System Folder, or do I just stick with SysEnvirons...
  80.  
  81. Not a big deal, but I guess you could say I am a stickler for details...
  82. :-)
  83.  
  84. - --Doug
  85. - --
  86. The new Congressmen say they're going to turn the government around.  I
  87. hope I don't get run over again.
  88.  
  89. +++++++++++++++++++++++++++
  90.  
  91. From: dodd@apple.com (Mike Dodd)
  92. Date: Mon, 3 Aug 1992 05:15:22 GMT
  93. Organization: Apple Computer Inc.
  94.  
  95. In article <199208030357.AA09618@SUNED.ZOO.CS.YALE.EDU>, bitting-douglas@CS.YALE.EDU (Pondscum Czar) writes:
  96. > Hi... I am trying not to use SysEnvirons to find the system folder (as,
  97. > really, SysEnvirons has been replaced w/ Sys7).  However, I need to make
  98. > sure this App works under System 6 as well... Anyway, I was poking
  99. > through the header files and found this in Folders.h:
  100. > --snip here--
  101. > #if SystemSevenOrLater
  102. > pascal OSErr FindFolder(short vRefNum,OSType folderType,Boolean
  103. > createFolder,
  104. >     short *foundVRefNum,long *foundDirID)
  105. >     = {0x7000,0xA823}; 
  106. > #else
  107. > pascal OSErr FindFolder(short vRefNum,OSType folderType,Boolean
  108. > createFolder,
  109. >     short *foundVRefNum,long *foundDirID);
  110. > #endif
  111. > --snip here--
  112. > Does the #else clause mean that THINK C provides glue for this function
  113. > like Gestalt?  In other words, can I use this under System 6 to find the
  114. > Active System Folder, or do I just stick with SysEnvirons...
  115.  
  116. yes, you can use it fine. if it doesn't define inline assembly (the
  117. "= {0x7000..." part), as the second definition doesn't, then that means
  118. that it includes glue for it (probably in MacTraps or MacTraps2). and, if 
  119. you use something that doesn't have inline assembly or glue, then your
  120. program will refuse to link, so at least you'll know that way.
  121.  
  122. - -Mike Dodd-
  123. Apple Computer
  124. ** What I say is my opinion. Not Apple's. **
  125.  
  126.  
  127. ---------------------------
  128.  
  129. From: djpegg@utkvx4.utk.edu (PEGG, DAVID J)
  130. Subject: How do I see if modifiers are down?
  131. Date: 31 Jul 92 18:45:00 GMT
  132. Organization: University of Tennessee Computing Center
  133.  
  134. I want to put a feature in my data analysis program that looks to see if Shift
  135. and Option are down (without any other keys).  If they are, then it gets the
  136. mouse position and tells you where it is in the graph's coordinates.  I'm using
  137. GetKeys to see if the keys are pressed.  But I can't seem to get my keyMap to
  138. show anything for any modifier keys (as well as some keys that really surprise
  139. me, like 't' and 'y').  Also, no number keys show up, on the number pad or on
  140. the regular keyboard.
  141.  
  142. I'm using Think C 5.0.2 with System 7, but programming using mostly stuff from
  143. IM volumes I & II.  I know it has to be possible to do this, since the Key Caps
  144. DA recognizes modifier keys, even when nothing else is pressed.
  145.  
  146. Thanks in advance for your help,
  147.       Mike
  148.  
  149. +++++++++++++++++++++++++++
  150.  
  151. From: buckeye@spf.trw.com (John Wallace)
  152. Date: 1 Aug 92 01:27:17 GMT
  153. Organization: TRW Data Systems Center, Redondo Beach, CA
  154.  
  155. In article <31JUL199213454178@utkvx4.utk.edu> djpegg@utkvx4.utk.edu (PEGG, DAVID J) writes:
  156. >I want to put a feature in my data analysis program that looks to see if Shift
  157. >and Option are down (without any other keys).  If they are, then it gets the
  158. >mouse position and tells you where it is in the graph's coordinates.  I'm using
  159. >GetKeys to see if the keys are pressed.  But I can't seem to get my keyMap to
  160. >show anything for any modifier keys (as well as some keys that really surprise
  161. >me, like 't' and 'y').  Also, no number keys show up, on the number pad or on
  162. >the regular keyboard.
  163. >
  164. >Thanks in advance for your help,
  165. >      Mike
  166.  
  167.  
  168. Rather than using the keymap directly, you may want to use
  169. GetNextEvent/WaitNextEvent to grab the next event and check the
  170. event's modifier fields for the shift/option/control keys and the
  171. where field for the mouse location (in global coordinates).
  172.  
  173. This has several advantages in that you don't have to muck with the
  174. keyboard resources to verify that the user hasn't re-mapped the key
  175. since it is possible for me to swap any of the keys on my keyboard.
  176. Also all of the info you want is available in one simple call.
  177.  
  178. If you don't want to actually remove any events from the event queue
  179. then pass in 0 for the event mask.
  180.  
  181. Cheers!
  182. John 
  183. - -----
  184. John Wallace     buckeye@spf.trw.com
  185.  
  186. +++++++++++++++++++++++++++
  187.  
  188. From: peter@cujo.curtin.edu.au (Peter N Lewis)
  189. Organization: NCRPDA, Curtin University
  190. Date: Mon, 3 Aug 1992 01:45:35 GMT
  191.  
  192. In article <2A79E875.14E5@deneva.sdd.trw.com>, buckeye@spf.trw.com (John
  193. Wallace) wrote:
  194.  
  195. > Rather than using the keymap directly, you may want to use
  196. > GetNextEvent/WaitNextEvent to grab the next event and check the
  197. > event's modifier fields for the shift/option/control keys and the
  198. > where field for the mouse location (in global coordinates).
  199.  
  200. In fact, OSEventAvail is even better, because it doesn't remove any events
  201. from the queue, and it won't try to switch you out or any foolishness:
  202.  
  203. dummy := OSEventAvail(0, event);
  204.  
  205. You can use this to get the mouse position as well, especially if you are a
  206. background only app and want to avoid calling GetMouse which explodes (why
  207. get the mouse position in a backgroun only app?  To test for idleness of
  208. course)
  209.  
  210. Have fun all,
  211.    Peter.
  212.  
  213. _______________________________________________________________________
  214. Peter N Lewis, NCRPDA, Curtin University       peter@cujo.curtin.edu.au
  215. GPO Box U1987, Perth WA 6001, AUSTRALIA             FAX: +61 9 367 8141
  216.  
  217. ---------------------------
  218.  
  219. From: jpurlia@qualcomm.com (John Purlia)
  220. Subject: Editor for mini icons?
  221. Date: 30 Jul 92 23:38:26 GMT
  222. Organization: Qualcomm, Inc.
  223.  
  224. Does anyone know of any utilities that allows for the creation of color
  225. icm# resources?  I'd like to be able to edit mini icons (12 x 12) in the
  226. same manner I edit larger icon families in ResEdit.
  227.  
  228. Thanks!
  229.  
  230. ...........................................................................
  231. John Purlia          : My brain; not my company's brain.  My brain says...
  232. jpurlia@qualcomm.com :      "Just about any movie could be made better
  233. AppleLink:  AM0470   :       if one of the characters were a vampire."
  234. ...........................................................................
  235.  
  236. +++++++++++++++++++++++++++
  237.  
  238. From: digi@dgp.toronto.edu (Chris DiGiano)
  239. Date: 3 Aug 92 20:59:30 GMT
  240.  
  241. jpurlia@qualcomm.com (John Purlia) writes:
  242.  
  243. >Does anyone know of any utilities that allows for the creation of color
  244. >icm# resources?  I'd like to be able to edit mini icons (12 x 12) in the
  245. >same manner I edit larger icon families in ResEdit.
  246.  
  247. I was looking for the same thing about a month ago.  It was suggested
  248. to me by Tim Dierks at Apple Computer to use the ResEdit 16x16 editor
  249. and then extract the left 12x12 pixels for the mini icon.  I wrote a
  250. utility program which takes an ICS#, ics4, or ics8 icon and converts
  251. it to the appropriate icm icon, by dropping off the last four rows of
  252. pixels and getting rid of the left-most four pixels for each row of
  253. the color icons.  When I drew the mini icons on the screen the results
  254. were a bit strange:
  255.  
  256. 1. Eventhough I used a 12x12 destination rectangle, the icm was
  257.    squashed horizontally.
  258.  
  259. 2. The color icons had a few pixels in the correct place with the
  260.    correct color, but most of it was garbled and had colors which were
  261.    not part of the original ics icons.
  262.  
  263. I changed my utility program to copy the entire row of 16 colored
  264. pixels, not just the first 12.  This seemed to fix the second
  265. problem--the colors were right and most pixels were in the right
  266. place.  But now just like their black and white cousins, the icon was
  267. compressed along the horizontal axis.
  268.  
  269. When I converted the B&W small icon below
  270.  
  271. X
  272.  X
  273.   X
  274.    X
  275.     X
  276.      X
  277.       X
  278.        X
  279.     X
  280.      X
  281.       X
  282.        X
  283.  
  284. It got a mini icon which looked like this on the screen:
  285.  
  286. X
  287.  X
  288.  X
  289.    X
  290.     X
  291.     X
  292.       X
  293.        X
  294.        X
  295.      X
  296.          X
  297.        X
  298.  
  299. That's all the progress I made before giving up and just using small
  300. icons in my application instead.  Let me know if you have any more luck.
  301.  
  302. - ---
  303. Chris DiGiano  (416) 978-6619, fax: 0458         digi@dgp.utoronto.{ca,bitnet}
  304. Dynamic Graphics Project, Dept. of Computer Sci.          digi@dgp.toronto.edu
  305. University of Toronto, Canada   M5S 1A4         ...!uunet!dgp.toronto.edu!digi
  306.  
  307. +++++++++++++++++++++++++++
  308.  
  309. From: jpurlia@qualcomm.com (John Purlia)
  310. Date: 3 Aug 92 22:19:29 GMT
  311. Organization: Qualcomm, Inc.
  312.  
  313. In article <1992Aug3.165930.8006@jarvis.csri.toronto.edu>,
  314. digi@dgp.toronto.edu (Chris DiGiano) wrote:
  315. > jpurlia@qualcomm.com (John Purlia) writes:
  316. > >Does anyone know of any utilities that allows for the creation of color
  317. > >icm# resources?  I'd like to be able to edit mini icons (12 x 12) in the
  318. > >same manner I edit larger icon families in ResEdit.
  319. > I was looking for the same thing about a month ago.  It was suggested
  320. > to me by Tim Dierks at Apple Computer to use the ResEdit 16x16 editor
  321. > and then extract the left 12x12 pixels for the mini icon.  I wrote a
  322. > utility program which takes an ICS#, ics4, or ics8 icon and converts
  323. > it to the appropriate icm icon, by dropping off the last four rows of
  324. > pixels and getting rid of the left-most four pixels for each row of
  325. > the color icons.  When I drew the mini icons on the screen the results
  326. > were a bit strange:
  327.  
  328. Actually, I came up with a compromise solution and basically handled my
  329. icons the same way the system does.  I created my 12x12 icons using
  330. ResEdit's 16x16 editor using the middle 12x12 pixels, then plotted the
  331. small icons with the destination rectangle overlapping my intended region
  332. by two pixels on each side.  Take a look at the SICN resources in the
  333. system used to plot icons in the Finder.  These icons are 16x16 but only
  334. use the middle 12x12 pixels.  I did the same thing, only using an icon
  335. family and it works MUCH better than plotting a full 16x16 icon within a
  336. 12x12 destination Rect.
  337. ...........................................................................
  338. John Purlia          : My brain; not my company's brain.  My brain says...
  339. jpurlia@qualcomm.com :      "Just about any movie could be made better
  340. AppleLink:  AM0470   :       if one of the characters were a vampire."
  341. ...........................................................................
  342.  
  343. ---------------------------
  344.  
  345. From: zeranguek@gtephx.UUCP (Karl Zerangue)
  346. Subject: Prolog for Mac
  347. Organization: gte
  348. Date: Mon, 27 Jul 1992 21:57:47 GMT
  349.  
  350. Does anyone know of a Prolog interpreter for the Macintosh?
  351.  
  352. Thanks in advance!
  353.  
  354. +++++++++++++++++++++++++++
  355.  
  356. From: perm@csd.uu.se (Per Mildner)
  357. Date: 28 Jul 92 17:32:55 GMT
  358. Organization: Computing Science Dept.,Uppsala University, Sweden
  359.  
  360.  
  361. We have ported our Prolog interpreter/compiler to the Mac. It was
  362. available on info-mac but has been removed. It is still available on
  363. some mirror sites. It is also available by anonymous ftp to
  364. ftp.csd.uu.se (directory /pub/Tricia/Mac/) where there is one extra
  365. version for use with 68000 processors (e.g., Classics).
  366.  
  367.  
  368. It is a WAM based vanilla prolog with no fancy Mac specific stuff
  369. except ADSP stream support. The ADSP support have been used to
  370. implement fancy user interfaces for expert systems using SuperCard.
  371.  
  372. Any questions should go to tricia-request@csd.uu.se (This includes
  373. requests for the source code).
  374. Regards,
  375. - --
  376. Per Mildner            perm@CSD.UU.SE
  377. Computing Science Dept.        tel: +46 18181049
  378. Uppsala University, Sweden    fax: +46 18521270
  379.  
  380. +++++++++++++++++++++++++++
  381.  
  382. From: marti@nugget.inf.ethz.ch (Robert Marti)
  383. Date: 3 Aug 92 16:16:43 GMT
  384. Organization: Dept. Informatik, Swiss Federal Institute of Technology (ETH), Zurich, CH
  385.  
  386. In article <wingo-280792084433@zardoz.apple.com>, wingo@apple.com
  387. (Tony Wingo) writes:
  388. |>
  389. |> In article <1992Jul27.215747.4560@gtephx.UUCP>, zeranguek@gtephx.UUCP
  390. |> (Karl Zerangue) wrote:
  391. |> >
  392. |> > Does anyone know of a Prolog interpreter for the Macintosh?
  393. |>
  394. |> Check out Open Prolog, available from 
  395. |>    grattan.cd.tcd.ie
  396. |> Last I checked it was in the directory tce/mac.
  397.  
  398.  
  399. Make that grattan.cs.tcd.ie .
  400.                   ^^
  401.  
  402. Also, Open Prolog is now in the directory languages/open-prolog.
  403. The curent version is 1.0d35.
  404.  
  405. - -- 
  406. Robert Marti                    |  Phone:    +41 1 254 72 60
  407. Informationssysteme             |  FAX:      +41 1 262 39 73
  408. ETH-Zentrum                     |  E-Mail:   marti@inf.ethz.ch
  409. CH-8092 Zurich, Switzerland     |
  410.  
  411. ---------------------------
  412.  
  413. From: ldh@svl.cdc.com (Lawrence D. Hare)
  414. Subject: ATrap to Determe my Mac name?
  415. Date: 30 Jul 92 17:57:45 GMT
  416. Organization: Control Data Systems
  417.  
  418. Well - I give up. Assuming that the name my Mac has (System 6 & 7) is the
  419. same
  420. as in a Unix /etc/hosts file, which it jolly well better be, I need to
  421. figure out
  422. what the name of the Mac I am running on is.
  423.  
  424. I have looked, and looked, and looked.... Surely there is a dead simple
  425. call!
  426.  
  427. Anyone know what it is and where it is documented?
  428. - --
  429. Lawrence D. Hare       Control Data - Silicon Valley Operations
  430. Consultant             Voice: (408) 496 4339 - C/N [234] 4339
  431. ldh@svl.cdc.com        Mail: SVLa60  FAX: (408) 496-4106
  432.  
  433. +++++++++++++++++++++++++++
  434.  
  435. From: peirce@outpost.SF-Bay.org (Michael Peirce)
  436. Date: 31 Jul 92 05:33:05 GMT
  437. Organization: Peirce Software
  438.  
  439.  
  440. In article <45905@shamash.cdc.com> (comp.sys.mac.programmer), ldh@svl.cdc.com (Lawrence D. Hare) writes:
  441. > Well - I give up. Assuming that the name my Mac has (System 6 & 7) is the
  442. > same
  443. > as in a Unix /etc/hosts file, which it jolly well better be, I need to
  444. > figure out
  445. > what the name of the Mac I am running on is.
  446. > I have looked, and looked, and looked.... Surely there is a dead simple
  447. > call!
  448. > Anyone know what it is and where it is documented?
  449.  
  450. This comes up ever month or so, but here it is again...
  451.  
  452. Under System 7 there are two name for a Mac.  The User Name (Choose
  453. name under pre-System 7) is found in the STR resource with ID = -16096
  454. in the System File.  The Machine name is found in the STR resource with
  455. ID = -16416.
  456.  
  457. You can fetch either of these by calling GetString() since the System
  458. File is open in your application.
  459.  
  460. I don't know how these names relate to the name found in a Unix system
  461. - - I don't do Unix :-)
  462.  
  463. - --  Michael Peirce      --   peirce@outpost.SF-Bay.org
  464. - --  Peirce Software     --   Suite 301, 719 Hibiscus Place
  465. - --                      --   San Jose, California USA 95117
  466. - --  Makers of...        --   voice: (408) 244-6554 fax: (408) 244-6882
  467. - --            SMOOTHIE  --   AppleLink: peirce & America Online: AFC Peirce
  468.  
  469. +++++++++++++++++++++++++++
  470.  
  471. From: mlanett@Apple.COM (Mark Lanett)
  472. Date: 31 Jul 92 07:07:28 GMT
  473. Organization: Apple Computer Inc., Cupertino, CA
  474.  
  475. peirce@outpost.SF-Bay.org (Michael Peirce) writes:
  476.  
  477.  
  478. >In article <45905@shamash.cdc.com> (comp.sys.mac.programmer), ldh@svl.cdc.com (Lawrence D. Hare) writes:
  479. >> Well - I give up. Assuming that the name my Mac has (System 6 & 7) is the
  480. >> same
  481. >> as in a Unix /etc/hosts file, which it jolly well better be, I need to
  482. >> figure out
  483. >> what the name of the Mac I am running on is.
  484.  
  485. [about the Chooser name]
  486.  
  487. >I don't know how these names relate to the name found in a Unix system
  488. >- I don't do Unix :-)
  489.  
  490. They don't relate. The Chooser name is only used by AppleTalk, not MacTCP.
  491. For that, you need to make MacTCP calls. Alas, I do sockets, not MacTCP,
  492. and I doubt I could extract meaningful code out of the socket library I
  493. use.
  494. - -- 
  495. Have a bajillion brilliant Jobsian lithium licks.
  496. Mark Lanett, NOT speaking for anyone. Personal opinion only.
  497.  
  498. +++++++++++++++++++++++++++
  499.  
  500. From: davidp@calvin.usc.edu (David Peterson)
  501. Date: 3 Aug 92 17:49:49 GMT
  502. Organization: University of Southern California, Los Angeles, CA
  503.  
  504.  
  505. There is no trap as far as I can tell, but if your name resolution
  506. stuff is working correctly just call AddrToName() with the ip number
  507. of your Mac (which you can get from GetMyIPAddr()).
  508.  
  509. Look in the MacTCP docs for details. GetMyIPAddr is on pg 87, 
  510. AddrToName on 75.
  511.  
  512. - -dave.
  513.  
  514. ---------------------------
  515.  
  516. From: jeremyr@dcs.qmw.ac.uk (Jeremy Roussak)
  517. Subject: AUX and memory
  518. Date: 3 Aug 92 19:42:28 GMT
  519. Organization: Computer Science Dept, QMW, University of London
  520.  
  521. I've written an INIT, called Apollo. To send AEvents, Apollo
  522. uses a small faceless background app called Eagle. All Eagle
  523. does it to open a PPC port and wait for messages from Apollo,
  524. which it converts into AEvents and sends.
  525.  
  526. Under MacOS, Eagle works perfectly in a 10k partition. Under
  527. AUX, however, it fails with insufficient memory (-108). If the
  528. partition is increased to 15k, it works nicely.
  529.  
  530. Why should this be?
  531.  
  532. Jeremy
  533.  
  534. +++++++++++++++++++++++++++
  535.  
  536. From: keith@taligent.com (Keith Rollin)
  537. Organization: Taligent
  538. Date: Tue, 4 Aug 1992 01:59:04 GMT
  539.  
  540. In article <1992Aug3.194228.6297@dcs.qmw.ac.uk>, jeremyr@dcs.qmw.ac.uk (Jeremy
  541. Roussak) writes:
  542. > I've written an INIT, called Apollo. To send AEvents, Apollo
  543. > uses a small faceless background app called Eagle. All Eagle
  544. > does it to open a PPC port and wait for messages from Apollo,
  545. > which it converts into AEvents and sends.
  546. > Under MacOS, Eagle works perfectly in a 10k partition. Under
  547. > AUX, however, it fails with insufficient memory (-108). If the
  548. > partition is increased to 15k, it works nicely.
  549. > Why should this be?
  550.  
  551. I think that applications are given a larger stack under A/UX. This is just a
  552. vague recollection, and, as a card-carrying Mac Bigot, I certainly don't have an
  553. A/UX system on which to check this out, so you'll have to verify this for
  554. yourself.
  555.  
  556. - --
  557. Keith Rollin
  558. Phantom Programmer
  559. Taligent, Inc.
  560.  
  561.  
  562. ---------------------------
  563.  
  564. From: crow@spicewood.uucp (David L. Crow)
  565. Subject: How do I sleep w/o using any CPU time
  566. Date: 11 Jul 1992 15:17:45 -0500
  567. Organization: UTexas Mail-to-News Gateway
  568.  
  569.     I am writing an application to check something every so often.  If
  570.   something exists, I will then put up an error window.  Everything is
  571.   done except that I don't know the best way to sleep until the next
  572.   check and use as little system resources (specifically CPU) as
  573.   possible.  In UNIX, I would just sleep and the process would be
  574.   put to sleep.
  575.  
  576.     I looked in the UNIX compatibility source in THINK C, and they
  577.   implemented a sleep as "Delay".  When I tried Delay, I couldn't
  578.   get control back from the app during the delay.
  579.  
  580.     I looked in the UUPC source, and they did it by getting the tick
  581.   count and then going through a while loop until so many ticks had
  582.   gone by.  While this works, it seems like it would not be very
  583.   efficient (read MultiFinder friendly) even though I don't have
  584.   any problems with UUPC and the MultiFinder.
  585.  
  586.     Basically, I guess that I just want to know the best way to put
  587.   my application to sleep for a given amount of time.
  588.  
  589.     Thanks for any help you can provide!
  590.  
  591.   David L. Crow    UUCP:  cs.utexas.edu!rpp386!spicewood!crow
  592.                Internet:  crow%spicewood@rpp386.lonestar.org
  593.  
  594. - ---
  595.  
  596. +++++++++++++++++++++++++++
  597.  
  598. From: cory@enigami.mv.com (Cory Kempf)
  599. Date: 12 Jul 92 05:55:50 GMT
  600. Organization: EnigamI, Inc., Nashua, NH
  601.  
  602.  
  603. In article <a684a397@spicewood.uucp> (comp.sys.mac.programmer), crow@spicewood.uucp (David L. Crow) writes:
  604. >    I am writing an application to check something every so often.  If
  605. >  something exists, I will then put up an error window.  Everything is
  606. >  done except that I don't know the best way to sleep until the next
  607. >  check and use as little system resources (specifically CPU) as
  608. >  possible.  In UNIX, I would just sleep and the process would be
  609. >  put to sleep.
  610.  
  611. MacOS Pet Peive #375: Delay doesn't give up the CPU.
  612.  
  613. The way to give up the CPU is to call WaitNextEvent, passing it a
  614. large number of the 3rd parameter (time that WNE can give away). 
  615. I usually use 50 or so (there was this bug a while back...).  By putting
  616. this inside a while loop that checks the tickcount, I give away as
  617. much CPU as I can.  
  618.  
  619. When an application is in the background, it doesn't get as much CPU
  620. to start with.  With a loop as described, its impact should be minimal.
  621.  
  622. +C
  623.  
  624.  
  625. - -------------------------------------------------------------
  626. Cory Kempf                    EnigamI, Inc.
  627. cory@enigami.mv.com           ...!decvax!enigami!cory
  628. Annon:    wi.5036@wizvax.methuen.ma.us
  629.  
  630. "F' cryin' out loud, it's *your* life; shouldn't you at least examine 
  631. your lifestyle values to see if they are really what *you* want."
  632.                                         --Keith Lim
  633.  
  634. +++++++++++++++++++++++++++
  635.  
  636. From: Andreas Wuertz <wuertz@systech.tik.ethz.ch>
  637. Organization: Swiss Federal Institute of Technology, TIK
  638. Date: Tue, 14 Jul 1992 11:49:05 GMT
  639.  
  640. In article <a684a397@spicewood.uucp> David L. Crow, crow@spicewood.uucp
  641. writes:
  642. >    Basically, I guess that I just want to know the best way to put
  643. >  my application to sleep for a given amount of time.
  644.  
  645. Use WaitNextEvent(myEventMask, &theEvent, maxidle, mouseRgn); see inside
  646. mac for exact definition of the parameters for this function. maxidle is
  647. the amount of ticks you want to sleep if no event is there for you; so
  648. you are woken up after maxidle ticks THE LATEST. If you want to make
  649. something periodically, you'd need to write something like: 
  650. if WaitNextEvent(myEventMask, &theEvent, maxidle, mouseRgn) {
  651.   if (theEvent.when-lastWakeup>=desiredIdle) {
  652.     HandlePeriodicAction();
  653.     maxIdle=desiredIdle;
  654.   } else
  655.     maxIdle=desiredIdle-(TickCount()-lastWakeup);
  656.   lastWakeup=TickCount();
  657. };
  658.  
  659. Not exactly, but I hope you get the idea. Hope this helps.
  660.  
  661. Andy
  662.  
  663. Andy from TIK
  664.  
  665. =======================================================
  666. The earliest time for a program to be bug-free is,
  667. when it's out of date. The latest time for a programmer
  668. to retire is, when he writes such a program.
  669. =======================================================
  670.  
  671. +++++++++++++++++++++++++++
  672.  
  673. From: resnick@cogsci.uiuc.edu (Pete Resnick)
  674. Organization: University of Illinois at Urbana
  675. Date: Tue, 14 Jul 1992 13:54:23 GMT
  676.  
  677. davidp@calvin.usc.edu (David Peterson) writes:
  678.  
  679. >How about during completion procs -- can't call WNE then.
  680.  
  681. >What I've been doing is parking in a SystemTask/TickCount loop. Will this
  682. >allow things to go on in the background? Will it allow other completion
  683. >procs to execute? (Skip reentrancy problems, I _think_ that's taken care
  684. >of)
  685.  
  686. Eeeee! This is a design problem, Dave.
  687.  
  688. If you are getting called at interrupt and it is not time to do what
  689. you have to do, you should do something that will cause another
  690. interrupt later when it is time and return immediately. If I had to
  691. wait for a certain time to roll around when my completion proc gets
  692. called I would do the following:
  693.  
  694. My completion proc does only one thing: install a Time Manager task
  695. that is set to go off at the appropriate time. My completion routine
  696. would simply figure out how much time I need to wait and install the
  697. TM task.
  698.  
  699. The completion routine for the TM task would do all of the work I need
  700. to do. If I determined in my original completion proc that I didn't
  701. need to wait at all, I could always call the TM task completion
  702. routine directly from there.
  703.  
  704. Things that execute at interrupt are doing so because "they must
  705. execute now and fast", as far as the OS is concerned. Do as little as
  706. possible during interrupt and don't hang on to the processor.
  707.  
  708. pr
  709. - --
  710. Pete Resnick             (...so what is a mojo, and why would one be rising?)
  711. Graduate assistant - Philosophy Department, Gregory Hall, UIUC
  712. System manager - Cognitive Science Group, Beckman Institute, UIUC
  713. Internet: resnick@cogsci.uiuc.edu
  714.  
  715. +++++++++++++++++++++++++++
  716.  
  717. From: ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
  718. Date: 15 Jul 92 18:07:17 +1200
  719. Organization: University of Waikato, Hamilton, New Zealand
  720.  
  721. In article <1992Jul13.150027.4926@usenet.ins.cwru.edu>, Jerome Chan <yjc@po.cwru.edu> writes:
  722. > In article <0105011F.8acslo@dragon.enigami.mv.com> Cory Kempf,
  723. > cory@enigami.mv.com writes:
  724. >>The way to give up the CPU is to call WaitNextEvent, passing it a
  725. >>large number of the 3rd parameter (time that WNE can give away).
  726. >>I usually use 50 or so (there was this bug a while back...).  By putting
  727. >>this inside a while loop that checks the tickcount, I give away as
  728. >>much CPU as I can.
  729.  
  730. The bug was in MultiFinder 1.0, System 4.2. i e it's long gone.
  731.  
  732. >   Hmm. But won't we be losing events if we do this? If windows are being
  733. > displayed and the user switches to another application under
  734. > multi-finder, won't we lose the the Update Event? Or is that the
  735. > Resume/Suspend Event?
  736.  
  737. It's the Resume/Suspend event, and I'm pretty sure you're right--I recall
  738. reading this in the MultiFinder documentation a while back, though I'm having
  739. difficulty finding the same info in IM6 chapter 5. Basically if you mask out
  740. app4/OS events, you won't see the suspend/resume events--they simply disappear.
  741.  
  742. You could of course put in calls to your regular suspend/resume event handling
  743. code in the delay loop. Another technique involves having only a single event
  744. loop in your program, and being able to selectively enable/disable handling
  745. of particular event types (e g mouse and key clicks) when your program is in a
  746. "busy" state. And being able to specify a "background" task to perform
  747. each time round the event loop.
  748.  
  749. Lawrence D'Oliveiro                       fone: +64-7-856-2889
  750. Computer Services Dept                     fax: +64-7-838-4066
  751. University of Waikato            electric mail: ldo@waikato.ac.nz
  752. Hamilton, New Zealand    37^ 47' 26" S, 175^ 19' 7" E, GMT+12:00
  753. The aliens are willing to spare the Earth, on condition we surrender to them
  754. the country responsible for Kylie Minogue.
  755.  
  756. +++++++++++++++++++++++++++
  757.  
  758. From: Bruce.Hoult@bbs.actrix.gen.nz
  759. Organization: Actrix Information Exchange
  760. Date: Wed, 15 Jul 1992 12:33:58 GMT
  761.  
  762. In article <1992Jul15.180717.9387@waikato.ac.nz> ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University) writes:
  763. > The aliens are willing to spare the Earth, on condition we surrender to them
  764. > the country responsible for Kylie Minogue.
  765.  
  766. ... not to mention "shrimp on the barbie" and the term of endearment "bogan".
  767. - -- 
  768. Bruce.Hoult@bbs.actrix.gen.nz   Twisted pair: +64 4 477 2116
  769. BIX: brucehoult                 Last Resort:  PO Box 4145 Wellington, NZ
  770. "Cray's producing a 200 MIPS personal computer with 64MB RAM and a 1 GB
  771. hard disk that fits in your pocket!"   "Great!  Is it PC compatable?"
  772.  
  773. +++++++++++++++++++++++++++
  774.  
  775. From: thomasc@dragonfly.wri.com (Thomas Chin)
  776. Organization: Wolfram Research, Inc.
  777. Date: Tue, 14 Jul 1992 16:15:50 GMT
  778.  
  779. >In article <a684a397@spicewood.uucp> David L. Crow, crow@spicewood.uucp
  780. >writes:
  781. >>    Basically, I guess that I just want to know the best way to put
  782. >>  my application to sleep for a given amount of time.
  783.  
  784. With system 7 process manager, you can have a time manager task which do
  785. a 'WakeUpProcess', install the timer, go into your yielding 'WaitNextEvent'
  786. with maximum sleep ticks and empty mask, you'll get a NULL event when the
  787. time is up!
  788.  
  789. - -Tom
  790.  
  791. +++++++++++++++++++++++++++
  792.  
  793. From: joshr@kronos.arc.nasa.gov (Joshua Rabinowitz-Summer-91)
  794. Date: 24 Jul 92 00:09:28 GMT
  795. Organization: NASA/ARC Information Sciences Division
  796.  
  797. In article <28474@goofy.Apple.COM> dwb@apple.com (David W. Berry) writes:
  798. >In article <a684a397@spicewood.uucp>, you write:
  799. >>    I am writing an application to check something every so often.  If
  800. >>  something exists, I will then put up an error window.  Everything is
  801. >Typed in off the type of my head, so this isn't error checked (or really
  802. >even syntax checked) but it will give you the general idea...
  803. >
  804. >pascal void Delay(long ticks)
  805. >{
  806. >        long            wakeTime = TickCount() + ticks;
  807. >        long            delay;
  808. >        EventRecord     event;
  809. >
  810. >        while((delay = (wakeTime - TickCount()) > 0)
  811. >                WaitNextEvent(0, &event, delay, 0);
  812. >}
  813.  
  814. The only problem with this, as I remember it
  815. (and please correct me if I'm wrong),
  816. that apple events cannot be masked.  I looked in inside mac for this, but
  817. could not find a reference to this ?fact?.  (looked at The Event Manager,
  818. IM VI, p. 5-29)  I cannot recall where I got this idea from.
  819.  
  820. Can anyone refute or back up this belief?
  821. - -- 
  822. - ----------------------------------
  823. #include <std/disclaimer.h>     Josh Rabinowitz, Mac TCL programmer
  824. joshr@kronos.arc.nasa.gov
  825. "'I see', said the blind carpenter, as he picked up his hammer and saw".
  826.  
  827. +++++++++++++++++++++++++++
  828.  
  829. From: dwb@apple.com (David W. Berry)
  830. Date: 17 Jul 92 21:19:45 GMT
  831. Organization: Greenwing Enterprises
  832.  
  833. In article <a684a397@spicewood.uucp>, you write:
  834. >    I am writing an application to check something every so often.  If
  835. >  something exists, I will then put up an error window.  Everything is
  836. Typed in off the type of my head, so this isn't error checked (or really
  837. even syntax checked) but it will give you the general idea...
  838.  
  839. pascal void Delay(long ticks)
  840. {
  841.         long            wakeTime = TickCount() + ticks;
  842.         long            delay;
  843.         EventRecord     event;
  844.  
  845.         while((delay = (wakeTime - TickCount()) > 0)
  846.                 WaitNextEvent(0, &event, delay, 0);
  847. }
  848.  
  849. +++++++++++++++++++++++++++
  850.  
  851. From: dowdy@apple.com (Tom Dowdy)
  852. Date: 20 Jul 92 15:15:13 GMT
  853. Organization: Apple Computer, Inc.
  854.  
  855. In article <1992Jul13.150027.4926@usenet.ins.cwru.edu>, yjc@po.cwru.edu
  856. (Jerome Chan) wrote:
  857. > In article <0105011F.8acslo@dragon.enigami.mv.com> Cory Kempf,
  858. > cory@enigami.mv.com writes:
  859. > >The way to give up the CPU is to call WaitNextEvent, passing it a
  860. > >large number of the 3rd parameter (time that WNE can give away). 
  861. > >I usually use 50 or so (there was this bug a while back...).  By putting
  862. > >this inside a while loop that checks the tickcount, I give away as
  863. > >much CPU as I can.  
  864. >   Hmm. But won't we be losing events if we do this? If windows are being
  865. > displayed and the user switches to another application under
  866. > multi-finder, won't we lose the the Update Event? Or is that the
  867. > Resume/Suspend Event?
  868.  
  869. Actually, you won't be losing events - however, there is a potential
  870. serious
  871. problem with calling WNE this way all of the time.  Note that in *this*
  872. particular case, the original poster (long since gone from this discussion,
  873. I would fear) wasn't going to have any windows open - he was simply running
  874. until an event happened, at which time a dialog box would be brought
  875. up (no doubt saying something such as "Your rendering is complete").
  876.  
  877. However, if you *do* have windows open, and fail to respond to update
  878. events, you will see very sluggish performance on your Mac as the
  879. process manager attempts to give you updateEvents over and over again.
  880. Eventually, when it sees some very large number of update events go
  881. by for the same window, it will assume you are clueless and clear
  882. the updateRgn itself - however, this takes almost a minute and a half.
  883.  
  884. The thing to learn is - always handle update events, and always call
  885. BeginUpdate()/EndUpdate() when handling them.
  886.  
  887.  Tom Dowdy                 Internet:  dowdy@apple.COM
  888.  Apple Computer MS:81KS    UUCP:      {sun,voder,amdahl,decwrl}!apple!dowdy
  889.  20525 Mariani Ave         AppleLink: DOWDY1
  890.  Cupertino, CA 95014       
  891.  "The 'Ooh-Ah' Bird is so called because it lays square eggs."
  892.  
  893. +++++++++++++++++++++++++++
  894.  
  895. From: cory@enigami.mv.com (Cory Kempf)
  896. Date: Fri, 24 Jul 92 11:52:07 EST
  897. Organization: EnigamI, Inc., Nashua, NH
  898.  
  899.  
  900. In article <dowdy-200792081218@90.10.20.25> (comp.sys.mac.programmer), dowdy@apple.com (Tom Dowdy) writes:
  901. >In article <1992Jul13.150027.4926@usenet.ins.cwru.edu>, yjc@po.cwru.edu
  902. >(Jerome Chan) wrote:
  903. >> 
  904. >> In article <0105011F.8acslo@dragon.enigami.mv.com> Cory Kempf,
  905. >> cory@enigami.mv.com writes:
  906. >> >The way to give up the CPU is to call WaitNextEvent, passing it a
  907. >> >large number of the 3rd parameter (time that WNE can give away). 
  908. >> >I usually use 50 or so (there was this bug a while back...).  By putting
  909. >> >this inside a while loop that checks the tickcount, I give away as
  910. >> >much CPU as I can.  
  911. >> 
  912. >>   Hmm. But won't we be losing events if we do this? If windows are being
  913. >> displayed and the user switches to another application under
  914. >> multi-finder, won't we lose the the Update Event? Or is that the
  915. >> Resume/Suspend Event?
  916. >
  917. >Actually, you won't be losing events - however, there is a potential
  918. >serious
  919. >problem with calling WNE this way all of the time.  Note that in *this*
  920. >particular case, the original poster (long since gone from this discussion,
  921. >I would fear) wasn't going to have any windows open - he was simply running
  922. >until an event happened, at which time a dialog box would be brought
  923. >up.
  924.  
  925. No, I'm still here, just a bit behind.
  926.  
  927. And yes, when I do actually do a delay like that, I am usually initializing
  928. my application, which (in many cases) requires that I wait for some
  929. hardware to respond.  The only window open at this point is the splash
  930. screen.  Normally though there is the possibility that the user would wish 
  931. to interact with them or make a selection from a menu (like Quit!), so I 
  932. would call my Yield(long time) routine instead. Yield() repeatedly calls 
  933. my main event function (the looping is done externaly) until 'time' had 
  934. passed. This has the added benefit of making sure the mouse was correct.
  935.  
  936. Some other magic was in place to prevent re-entrancy.
  937.  
  938. Usually though, if I am doing something that is long and involved,
  939. I would put up a dialog box with a thermometer in it (movable modal,
  940. of course!) to let the user know how much longer until I was finished.
  941.  
  942. >However, if you *do* have windows open, and fail to respond to update
  943. >events, you will see very sluggish performance on your Mac as the
  944. >process manager attempts to give you updateEvents over and over again.
  945. >Eventually, when it sees some very large number of update events go
  946. >by for the same window, it will assume you are clueless and clear
  947. >the updateRgn itself - however, this takes almost a minute and a half.
  948.  
  949. Would this still happen if the first parameter to WNE was 0, indicating
  950. that I didn't want ANY events?
  951.  
  952. +C
  953.  
  954.  
  955. - -------------------------------------------------------------
  956. Cory Kempf                    EnigamI, Inc.
  957. cory@enigami.mv.com           ...!decvax!enigami!cory
  958. Annon:    wi.5036@wizvax.methuen.ma.us
  959.  
  960. "F' cryin' out loud, it's *your* life; shouldn't you at least examine 
  961. your lifestyle values to see if they are really what *you* want."
  962.                                         --Keith Lim
  963.  
  964. +++++++++++++++++++++++++++
  965.  
  966. From: jtn@ADS.COM (John T. Nelson)
  967. Date: 4 Aug 92 03:29:43 GMT
  968. Organization: Advanced Decision Systems, Mtn. View, CA (415) 960-7300
  969.  
  970. Why not use the time manager to schedule tasks?  Delay loops are crude.
  971.  
  972. - - Hacker
  973.  
  974. ---------------------------
  975.  
  976. From: paul@fairgate.uucp (Paul Robichaux)
  977. Subject: Naming my print job: how?
  978. Date: 4 Aug 92 05:26:31 GMT
  979. Organization: Fairgate Technologies
  980.  
  981. After a bit of hacking to make my plotting and printing code work
  982. properly (thanks to Apple for their source code snippets, especially
  983. HairLines), I'd like to dress up my printing routines a bit.
  984.  
  985. Right now, my app has one main window (titled "Control"), and whenever
  986. I print a document from it, the print job has that same title. I know
  987. it's possible to tag the job with an arbitrary title ("foo @ HellWriter"
  988. has sort of a nice ring to it) and would like to add this feature to
  989. my application, so that I can identify the specific kind of plot or
  990. graph being printed instead of just "Control."
  991.  
  992. I'll post a summary of responses.
  993.  
  994. - -Paul
  995.  
  996. - ---
  997.                              Paul Robichaux, KD4JZG                       
  998.          paul@fairgate.uucp -or- ...uunet!{sci34hub,xavax}!fairgate!paul
  999.  
  1000. +++++++++++++++++++++++++++
  1001.  
  1002. From: zben@ni.umd.edu (Charles B. Cranston)
  1003. Organization: UM Home for the Terminally Analytical
  1004. Date: Tue, 4 Aug 1992 21:13:46 GMT
  1005.  
  1006. In article <a6a37127@fairgate.uucp>, paul@fairgate.uucp (Paul Robichaux)
  1007. wrote:
  1008.  
  1009. > Right now, my app has one main window (titled "Control"), and whenever
  1010. > I print a document from it, the print job has that same title. I know
  1011. > it's possible to tag the job with an arbitrary title ("foo @ HellWriter"
  1012. > has sort of a nice ring to it) and would like to add this feature to
  1013. > my application, so that I can identify the specific kind of plot or
  1014. > graph being printed instead of just "Control."
  1015.  
  1016. As I understand it the printing complex takes the frontmost window's
  1017. title as the job name.  I suppose you could always temporarily change
  1018. the window's title for just the duration of the printing.
  1019.  
  1020. zben@ni.umd.edu     -KA3ZDF
  1021.  
  1022. ---------------------------
  1023.  
  1024. From: kofoid@bioscience.utah.edu (Eric C. Kofoid)
  1025. Subject: alias pathname
  1026. Date: 3 Aug 92 22:18:32 GMT
  1027. Organization: Dept. Biology, University of Utah
  1028.  
  1029. I want a getFile dialog to return the pathname to an alias itself, *not* 
  1030. the target of an alias. Since StandardGetFile always resolves the alias, 
  1031. I decided to use a call to CustomGetFile. My dialog hook function traps 
  1032. the pseudo-items "sfHookOpenAlias" and "sfHookGoToaliasTarget", but I 
  1033. discover that I haven't the slightest idea what to do at this point. 
  1034. Simply returning a null event at this point selects nothing in the dialog 
  1035. list. Any ideas?
  1036.  
  1037. I want my users to be able to create a default list of of input files
  1038. which 
  1039. will be maintained during future activations of the program. Say that one 
  1040. of the files lives on a file server. When users wish to add this to the 
  1041. list, they use a getFile dialog. This in turn resolves the alias and adds 
  1042. its target to the list of files. This is fine, as long as there is a 
  1043. connection to the file server. However, if naive users activate the
  1044. program 
  1045. when the connection is not there, then they will be informed that the 
  1046. volume is not mounted or that the file does not exist. If the alias
  1047. itself 
  1048. were named in the list, a login dialog would appear allowing the user to 
  1049. create the connection immediately (no connection), or the alias target 
  1050. would be opened in the normal fashion (connection already there). 
  1051.  
  1052.  __________________________________________________________________
  1053. |  Eric Kofoid                         Dept.Biology, U. of Utah    |
  1054. |  "Being certain of the conclusion assists in finding the proof"  |
  1055. |                                      Galileo, 17th century       |
  1056. |__________________________________________________________________|
  1057.  
  1058. +++++++++++++++++++++++++++
  1059.  
  1060. From: ross@bnr.ca (Ross Brown)
  1061. Date: 4 Aug 92 14:13:44 GMT
  1062. Organization: Bell-Northern Research
  1063.  
  1064. In article <1992Aug3.221832.4563@fcom.cc.utah.edu> Eric C. Kofoid
  1065. <kofoid@bioscience.utah.edu> writes:
  1066. >I want a getFile dialog to return the pathname to an alias itself, *not* 
  1067. >the target of an alias. Since StandardGetFile always resolves the alias, 
  1068. >I decided to use a call to CustomGetFile. My dialog hook function traps 
  1069. >the pseudo-items "sfHookOpenAlias" and "sfHookGoToaliasTarget", but I 
  1070. >discover that I haven't the slightest idea what to do at this point. 
  1071. >Simply returning a null event at this point selects nothing in the dialog 
  1072. >list. Any ideas?
  1073.  
  1074. You need to "map" sfHookOpenAlias to sfItemOpenButton.
  1075. This works for me in MPW C:
  1076.  
  1077. pascal short DefeatAliasDialogHook( short item, DialogPtr theDialog,
  1078.                                     Ptr myDataPtr )
  1079. {
  1080. #pragma    unused( theDialog, myDataPtr )
  1081.     if( item == sfHookOpenAlias )
  1082.         return sfItemOpenButton;
  1083.     else
  1084.         return item;
  1085. }
  1086.  
  1087. ...
  1088. CustomGetFile( (FileFilterYDProcPtr) AliasOnlyFileFilter, -1, nil, &reply,
  1089.                0, centerScreen, DefeatAliasDialogHook, nil, nil, nil, nil );
  1090. ...
  1091.  
  1092. Your file filter (first argument) would probably be "nil".
  1093.  
  1094. W. Ross Brown                 |        from Brown's Bestiary of the Macintosh:
  1095. Advisor, Telemanagement Svcs. |  PBCatMoof:  A purring system trap shaped like
  1096. Bell-Northern Research Ltd.   | a dog with cow spots and a 3-hr. battery life.
  1097. Ottawa, Ontario, Canada       | ----------------------------------------------
  1098. ross@bnr.ca                   |      Any opinion expressed is mine, not BNR's.
  1099.  
  1100. ---------------------------
  1101.  
  1102. End of C.S.M.P. Digest
  1103. **********************
  1104.